package com.game.betLottery.model;

import java.util.List;

import com.eova.common.base.BaseModel;

public class GameRuleInfo extends BaseModel<GameRuleInfo> {

	private static final long serialVersionUID = 1L;
	public static final GameRuleInfo dao = new GameRuleInfo();

	public int findOdds(int rif) {
		StringBuffer incomeSql = new StringBuffer(); // 是否押中
		incomeSql
				.append("SELECT  rif.odds as odds FROM game_rule_info rif INNER JOIN game_detail_info gdf ON rif.id=gdf.ruleId ");
		GameRuleInfo gif = this.findFirst(incomeSql.toString());
		int number = 0;
		if (gif != null) {
			number = gif.get("odds");
		}
		return number;
	}

	/**
	 * 描述:获取游戏规则的集合 作者:gyp
	 */
	public List<GameRuleInfo> getGameRuleInfos() {
		String sql = "select * from game_rule_info where isDelete = 0 order by id";
		return this.find(sql);
	}

	/**
	 * 描述:根据id获取游戏规则的信息 作者:gyp
	 */
	public GameRuleInfo getGameRuleInfo(String id) {
		String sql = "select * from game_rule_info where id = ?";
		return this.findFirst(sql, id);
	}

}
